package com.foreverwin.jzymes.production.dismantle.service.impl;

import com.foreverwin.jzymes.common.service.ICarrierBindAdviceService;
import com.foreverwin.jzymes.production.dismantle.service.IDismantleAlarmDisposeAdviceService;
import com.foreverwin.jzymes.production.inspect.service.IInspectAlarmDisposeAdviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.Map;

@Service
public class DismantleAlarmDisposeAdviceServiceImpl implements IDismantleAlarmDisposeAdviceService {

    @Autowired
    IInspectAlarmDisposeAdviceService inspectAlarmDisposeAdviceService;
    @Autowired
    ICarrierBindAdviceService carrierBindAdviceService;


    @Transactional( propagation = Propagation.REQUIRED, rollbackFor = Exception.class )
    public void disposeDismantleAlarm( Map<String,Object> jsonMap ){
        /**不良项目处置*/
        inspectAlarmDisposeAdviceService.disposeAlarmNC( jsonMap );
        /**本体解绑*/
        carrierBindAdviceService.carrierUnBind( (String)jsonMap.get("site"), (String)jsonMap.get("carrier"), new Date() );
    }
}
